package ssm.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import ssm.service.IShardingJdbcService;

import java.util.ArrayList;

@Controller
@RequestMapping("ssm")
public class ShardingJdbcController {

    @Autowired
    private IShardingJdbcService iShardingJdbcService;

    @RequestMapping("/insert")
    @ResponseBody
    public String insert() {
        String msg = iShardingJdbcService.insert();
        return msg;
    }

    @RequestMapping(value = "/list", method = RequestMethod.GET)
    @ResponseBody
    public String list() {
        String msg = iShardingJdbcService.list();
        return msg;
    }

    @RequestMapping(value = "/delete", method = RequestMethod.POST)
    @ResponseBody
    public String delete() {
        iShardingJdbcService.delete();
        return "msg";
    }

}
